import { defineStore } from "pinia";

export const useCountStore = defineStore("count", {
  // actions里面放的是方法，用于响应组件中的“动作”
  actions: {
    increment(value:number) {
     this.sum += value
    },
    decrement(value:number) {
      this.sum -= value
    }
  },
  state() {
    return {
      sum: 6,
    };
  },
  getters: {
    bigSum(state) {
      return state.sum * 10
    }
  }
});
